import { Context } from 'hono'


// Error Handler
export const errorHandler = (c: Context) => {
  console.log(c.res.status)

  return c.json({
    code: 500,
    msg: c.error?.message,
    data: process.env.NODE_ENV === 'production' ? null : c.error?.stack,
  }, 500)
}


// Not Found Handler
export const notFound = (c: Context) => {
  // msg: `Not Found - [${c.req.method}] ${c.req.url}`,
  return c.json({
    code: 404,
    msg: 'Not Found',
  }, 404)
}
